package com.itheima.demo1;

import java.sql.SQLOutput;

public class SystemDemo {
    public static void main(String[] args) {
        // 终止当前Java虚拟机
        System.out.println(111);
//        System.exit(0);
        System.out.println(222);

        // 返回当前时间
        long start = System.currentTimeMillis();

        for (int i = 0; i < 10000; i++) {
            System.out.println(i);
        }
        long end = System.currentTimeMillis();
        System.out.println(end - start);

        // 数组复制
        // arraycopy(数据源数组, 起始索引, 目的地数据, 起始索引, 拷贝个数);
        int[] arr1 = {1, 2, 3, 4, 5};
        int[] arr2 = new int[10];

        System.arraycopy(arr1, 0, arr2, 0, arr1.length);
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
        System.out.println("--------");
        System.arraycopy(arr1, 3, arr2, 8, 2);
        for (int i = 0; i < arr2.length; i++) {
            System.out.println(arr2[i]);
        }
    }
}
